import http from "@/api";
import { ResPage, Market } from "@/api/interface/index";
import qs from "qs";

//友情链接列表
export const getFriendLinkList = (params: Market.FriendLinkParams) => {
  return http.post<ResPage<Market.FriendLinkParams>>(`friendLink/list`, qs.stringify(params));
};
//编辑友情链接
export const saveFriendLink = (params: Market.FriendLinkParams) => {
  return http.post(`friendLink/save`, qs.stringify(params));
};
//删除友情链接
export const delFriendLink = (params: { ids: number }) => {
  return http.post(`friendLink/del`, qs.stringify(params));
};

//广告位列表
export const getAdvPositionList = (params: Market.AdvPositionParams) => {
  return http.post<ResPage<Market.AdvPosition>>(`advPosition/list`, qs.stringify(params));
};
//编辑广告位
export const saveAdvPosition = (params: Market.AdvPosition) => {
  return http.post(`advPosition/save`, qs.stringify(params));
};
//删除广告位
export const delAdvPosition = (params: { codes: string }) => {
  return http.post(`advPosition/del`, qs.stringify(params));
};

//广告位列表
export const getAdvList = (params: Market.AdvParams) => {
  return http.post<ResPage<Market.Adv>>(`adv/list`, qs.stringify(params));
};
//编辑广告位
export const saveAdv = (params: Market.Adv) => {
  return http.post(`adv/save`, qs.stringify(params));
};
//删除广告位
export const delAdv = (params: { ids: number }) => {
  return http.post(`adv/del`, qs.stringify(params));
};
